Automatic lighting and security device

ABSTRACT

In a number of aspects, the invention discloses a device ( 100 ) comprising one or more infrared light sources ( 40, 41 ); one or more visible light sources ( 50, 51 ); an image sensor ( 10 ); a processing unit ( 20 ) configured to analyze a series of images of a region of interest output by the image sensor; a control unit ( 30 ) configured to generate one or more of an activation of the one or more visible light sources or an alarm based on a command received from the processing unit; wherein the analyze comprises detecting a moving foreground in the series of images of the region of interest, tracking one or more characterizing features in the moving foreground and classifying the one or more characterizing features into two of more types of objects of interest, a type of an object of interest determining a command sent by the processing unit to the control unit.

FIELD OF THE INVENTION

The technical field of the invention is that of automatic lighting, andin particular that of the automatic lighting of an outside environment.The present invention relates to an automatic lighting device.

BACKGROUND

In order to illuminate an outside environment, it is known practise touse an automatic lighting device comprising a motion detector. Themotion detector typically uses an infrared technology. When a motion isdetected, the device activates lighting. When no motion is detected, thedevice deactivates the lighting.

Such a device does however present the drawback of not making anydistinction between different categories of objects. The lighting isthus triggered as soon as a motion is detected, whether it is forexample the motion of a pedestrian, of an animal, or of a vehicle. Thiscreates unnecessary light pollution.

A number of prior art documents disclose image sensors that are capableof detecting and classifying moving objects or beings in a scene orregion of interest (RoI) to generate a number of actions when one ormore triggering events are identified. Such is the case of US patentsand patent applications published under numbers U.S. Pat. No. 9,215,781,US2005002572, US2015062337.

But these devices and systems have some limitations notably becauseimproved identification accuracy comes at the expense of either anincrease in the number of false alarms or an increase in the computingpower requirements or both. There is therefore a need for a device withan improved balance between high identification accuracy, low falsealarms rate, low computing power requirement, especially in a homeenvironment.

SUMMARY OF THE INVENTION

To this effect, the invention discloses a device comprising an imagesensor, an IR light source, a visible light source and a processing unitconfigured to detect moving foreground elements of a scene, to trackthem and to classify them into different types of objects of interestthat may trigger or not the illumination of the scene by the visiblelight source or an alarm.

More precisely, this invention discloses a device comprising: one ormore infrared light sources; one or more visible light sources; an imagesensor; a processing unit configured to analyze a series of images of aregion of interest output by the image sensor; a control unit configuredto generate one or more of an activation of the one or more visiblelight sources or an alarm based on a command received from theprocessing unit; wherein the analyze comprises detecting a movingforeground in the series of images of the region of interest, trackingone or more characterizing features in the moving foreground andclassifying the one or more characterizing features into two of moretypes of objects of interest, a type of an object of interestdetermining a command sent by the processing unit to the control unit.

Advantageously, the device of the device of the invention is furtherconnected to a network through a communication link, wherein the alarmis sent to a user device on the communication link.

Advantageously, the control circuit further triggers images of theobject of interest to be sent to the user device on the communicationlink.

Advantageously, the detecting uses a Y luminance value in a YUV encodingof pixels in the series of images.

Advantageously, the detecting comprises comparing difference imagesbetween the series of images of the region of interest and images of aBackground Model of said region of interest to threshold images, thethreshold images being calculated dynamically using a Shifted Variance.

Advantageously, the tracking comprises allocating a Good Feature valueto a characterizing feature in Bounded Blocks output by the detecting ifa counter of correlated movements of the characterizing feature isincreased and a counter of immobility is equal to zero.

Advantageously, the tracking further comprises creating a vignette witha Bounded Block having a number of Good Features higher than athreshold.

Advantageously, the classifying comprises using one or more of a NeuralNetwork, a History of Oriented Gradient or a Support Vector Machineclassifier.

Advantageously, the Neural Network is a Convolutional Neural Networkclassifier and comprises one or more Fully Connected Layers.

Advantageously, the camera comprises a lens and an infrared light andvisible light sensor, the at least one infrared light source has a coneof emission of infrared light, the at least one visible light source hasa cone of emission of visible light, there is no intersection betweenthe lens of the camera on the one hand and the cones of emission ofinfrared light and of visible light on the other hand.

Advantageously, the lens has an axis of revolution A and comprises afirst face having a normal vector oriented towards the sensor and asecond face having a normal vector oriented towards the environment, andin which a first plane tangential to the first face and at right anglesto the axis of revolution A defines a first half-space to which thesensor belongs and a second half-space to which the second face of thelens and the environment belong, and the cone of emission of the atleast one infrared light source has a vertex arranged in the secondhalf-space; the cone of emission of the at least one visible lightsource has a vertex arranged in the second half-space.

Advantageously, the at least one infrared light source has a cone ofemission of axis A40, the at least one visible light source has a coneof emission of axis A50, and the camera has a cone of absorption of axisA, in the second half-space, the distance between the axis A40 and theaxis A is constant or increasing when moving away from the first plane,and in the second half-space, the distance between the axis A50 and theaxis A is constant or increasing when moving away from the first plane.

Advantageously, the device of the invention comprises a plurality ofvisible light sources, each visible light source having a cone ofemission having an axis, wherein in the first half-space, for eachvisible light source of the plurality of visible light sources, thedistance between the axis of the cone of emission of said source and theaxis of the cone of emission of each other source is constant orincreasing when moving away from the first plane.

Advantageously, the lens has an axis of revolution A, further comprisinga protection element for the at least one infrared light source, for theat least one visible light source and for the lens of the camera, theprotection element being transparent to the infrared light and to thevisible light, the protection element extending substantially along aplane at right angles to the axis of revolution A.

The invention also discloses a method of monitoring a region of interestcomprising: lighting the region of interest with one or more infraredlight sources; capturing series of images of the region of interest byan image sensor; analyzing by a processing unit the series of images ofthe region of interest output by the image sensor; generating by acontrol unit one or more of an activation of one or more visible lightsources or an alarm based on a command received from the processingunit; wherein the analyze comprises detecting a moving foreground in theseries of images of the region of interest, tracking one or morecharacterizing features in the moving foreground and classifying the oneor more characterizing features into two of more types of objects ofinterest, a type of an object of interest determining a command sent bythe processing unit to the control unit.

The device of the invention also brings improved security to thelocation where it is installed.

In some embodiments it may be controlled remotely, possibly through theinternet.

It is quite versatile because its software may be updated from time totime to improve detection, tracking or classification efficiency andthus still decrease the number of false positive and/or false negative.

By virtue of one aspect of the invention, the environment is lit withinfrared light, in a range of wavelengths invisible to the human eye.The camera picks up an infrared light reflected by the environment andproduces at least one image of the environment from the infrared lightreflected by the environment.

The processing unit assigns, to at least a part of this image, at leastone class out of a plurality of classes. In other words, one or moreclasses can be assigned to the entire image or to a part of the image.The control unit activates the visible light source as a function of theclass assigned to each area of interest detected. A user can thusadvantageously chose one or more classes for which he or she wants thelighting with visible light to be activated. The lighting with visiblelight remains deactivated for all the classes that the user has notchosen. The plurality of classes typically comprises:

-   -   a first class for a given category, and    -   a second class for everything which does not belong to the given        category.        The plurality of classes can alternatively comprise three or        more classes.

In addition to the features which have just been described in the aboveparagraph, the automatic lighting device according to one aspect of theinvention can have one or more additional features out of the following,considered individually or in all technically possible combinations:

-   -   The processing unit detects at least one area of interest within        the image and assigns at least one class out of the plurality of        classes to each area of interest detected. “Detection of at        least one area of interest” should be understood to mean a        search for at least one area of interest. The result of this        search can be positive or negative. The result of this search is        positive if at least one area of interest is detected. The        result of this search is negative if no area of interest is        detected.    -   An area of interest can be an area exhibiting a motion.        Alternatively, the area of interest can be a predefined area,        and in particular an area predefined by a user.    -   The camera films the environment lit by the at least one        infrared light source to obtain a film of N images with N being        a natural integer greater than or equal to 2, and the processing        unit performs:        -   for each pair of immediately consecutive images of the film,            a detection of at least one area of interest exhibiting a            motion;        -   for each area of interest detected:            -   a tracking in time of said area of interest so as to                obtain a set of k thumbnail images of said area of                interest with k being a natural integer less than or                equal to N, each of the k thumbnail images comprising                said area of interest, the k thumbnail images being                extracted from k immediately consecutive images of the                film;            -   a choice of at least one thumbnail image out of the set                of k thumbnail images;            -   an application of a classification algorithm to the at                least one thumbnail image chosen, for the assignment to                the area of interest contained in the chosen thumbnail                image of a class out of the plurality of classes.

A first image of the film, filmed at a time t1, and a second image ofthe film, filmed at a time t2 later than the time t1, are “immediatelyconsecutive” if there is no image of the film filmed at a time t suchthat t1<t<t2.

A thumbnail image extracted from an image can have pixel dimensions lessthan or equal to the pixel dimensions of the image from which it isextracted.

One and the same area of interest which moves in the field of the cameraappears on a plurality of k immediately consecutive images. For eachimage of the plurality of images, a thumbnail image is then definedwhich contains said area of interest. A plurality of N thumbnail imagesis obtained. The tracking of such an area of interest advantageouslymakes it possible to associate the plurality of N thumbnail images withsaid single area of interest. Detecting N areas of interest with asingle thumbnail image associated with each of the N areas of interestis thus avoided.

Choosing a subset of p thumbnail images out of the plurality of Nthumbnail images of said area of interest, with p being a naturalinteger such that: 1≤p<N, and applying the classification algorithm tosaid subset of p thumbnail images chosen, rather than to the pluralityof N thumbnail images, advantageously makes it possible to minimize thecomputation time linked to the operation of the classificationalgorithm. Choosing a subset of p thumbnail images out of the pluralityof N thumbnail images of said area of interest also makes it possible toimprove the accuracy of the classification algorithm, by providing theclassification algorithm with an input datum of good quality. The subsetof p thumbnail images can in fact be chosen, from the plurality of Nthumbnail images, for its intrinsic qualities. In a complementary oralternative manner, the subset of p thumbnail images can be processed inorder to improve the properties thereof.

According to a refinement, the step of detection, for each pair ofimmediately consecutive images of the film, of at least one area ofinterest exhibiting a motion comprises:

-   -   a first substep according to which a set of areas in motion is        detected, and    -   a second substep according to which a filter is applied to the        set of areas in motion previously detected, in order to        eliminate at least one first type of motion.

The motion of a cloud and the motion of a tree branch stirred by thewind belong, for example, to the first type of motions.

Each thumbnail image of the set of k thumbnail images of each area ofinterest detected can be defined as being the smallest rectanglecontaining said area of interest detected. The size of each thumbnailimage is thus minimized, which makes it possible to reduce thecomputation time linked to the operation of the classificationalgorithm. Alternatively, each thumbnail image of the set of k thumbnailimages of each area of interest detected can be defined as being thesmallest ellipse containing said area of interest detected, or as beingthe smallest polygon containing said area of interest detected. Thedimensions of a thumbnail image can vary from one area of interest toanother. The dimensions of a thumbnail image can also vary during thetracking of one and the same area of interest.

For each area of interest detected, the choice of the single thumbnailimage out of the set of k thumbnail images is advantageously made as afunction of a type of movement of said area of interest.

The device advantageously has a first mode of operation according towhich the choice of the single thumbnail image is made from a subset ofthe set of k thumbnail images, the subset comprising the q first imagesof the set of k thumbnail images, with q being a natural integer lessthan or equal to 10, and preferentially less than or equal to 5. A highdegree of responsiveness of the lighting device is thus advantageouslymade possible according to one aspect of the invention.

The camera comprising a lens and an infrared light and visible lightsensor, the at least one infrared light source having a cone of emissionof infrared light, and the at least one visible light source having acone of emission of visible light, the device is advantageously suchthat there is no intersection between the lens of the camera on the onehand and the cones of emission of infrared light and of visible light onthe other hand.

“There is no intersection between the lens of the camera on the onehand, and the cones of emission of infrared light and of visible lighton the other hand” should be understood to mean the fact that, for acamera comprising a sensor and a lens, the lens having a first faceoriented towards the sensor and a second face oriented towards theenvironment, the cone of emission of infrared light and the cone ofemission of visible light do not reach the lens:

-   -   either on its first face, or on its second face,    -   either directly, or after a reflection on a protective element.        Any glare and any pollution of the lens of the camera by any one        of the infrared or visible light sources is thus avoided.

The lens having an axis of revolution A and comprising a first facehaving a normal vector oriented towards the sensor and a second facehaving a normal vector oriented towards the environment, and a firstplane tangential to the first face and at right angles to the axis ofrevolution A defining a first half-space to which the sensor belongs anda second half-space to which the second face of the lens and theenvironment belong, the device is advantageously such that:

-   -   the cone of emission of the at least one infrared light source        has a vertex arranged in the second half-space;    -   the cone of emission of the at least one visible light source        has a vertex arranged in the second half-space.

The lens having an axis of revolution A, the device advantageouslycomprises a protection element for the at least one infrared lightsource, for the at least one visible light source and for the lens ofthe camera, the protection element being transparent to the infraredlight and to the visible light, the protection element extendingsubstantially along a plane at right angles to the axis of revolution A.The device is thus made seal-tight, for use in an outside environmentregardless of weather conditions. The integrity of the settings of thedevice in case of manipulation by a user is also guaranteed. Finally,the user manipulating the device is protected from any burns due to theinfrared and visible light sources.

The at least one infrared light source having a cone of emission of axisA40, the at least one visible light source having a cone of emission ofaxis A50, and the camera having a cone of absorption of axis A, thedevice is advantageously such that:

-   -   in the second half-space, the distance between the axis A40 and        the axis A is constant or increasing when moving away from the        first plane, and    -   in the second half-space, the distance between the axis A50 and        the axis A is constant or increasing when moving away from the        first plane.

A reflection of infrared or visible light on the protection elementreaching the lens, and in particular the second face of the lens, isthus avoided.

The device advantageously comprises a plurality of visible lightsources, each visible light source having a cone of emission having anaxis. In the first half-space, for each visible light source of theplurality of visible light sources, the distance between the axis of thecone of emission of said source and the axis of the cone of emission ofeach other source is advantageously constant or increasing when movingaway from the first plane.

A region is thus obtained, in the second half-space, in which at leasttwo cones of emission of visible light overlap. The uniformity of thelighting with visible light is thus improved, notably by eliminating anycentral halo.

The device advantageously comprises a plurality of infrared lightsources, each infrared light source having a cone of emission having anaxis. In the first half-space, for each infrared light source of theplurality of infrared light sources, the distance between the axis ofthe cone of emission of said source and the axis of the cone of emissionof each other source is advantageously constant or increasing whenmoving away from the first plane.

A region is thus obtained, in the second half-space, in which at leasttwo cones of emission of infrared light overlap. The uniformity of thelighting with infrared light is thus improved, notably by eliminatingany central halo.

BRIEF DESCRIPTION OF THE DRAWINGS

The invention and its advantages will be better understood upon readingthe following detailed description of a particular embodiment, givenpurely by way of non-limiting example, this description being made withreference to the accompanying drawings in which:

FIG. 1 shows a schematic representation of an automatic lighting deviceaccording to a first embodiment of the invention;

FIG. 2 shows a schematic representation of an automatic lighting deviceaccording to a second embodiment of the invention;

FIG. 3 shows a schematic representation of an automatic lighting deviceaccording to a third embodiment of the invention;

FIG. 4a shows a first cross-sectional view of the automatic lightingdevice according to the third embodiment of the invention;

FIG. 4b shows a second cross-sectional view of the automatic lightingdevice according to the third embodiment of the invention;

FIG. 5 shows a cross-sectional view of an automatic lighting deviceaccording to a variant of the third embodiment of the invention;

FIG. 6 shows a schematic representation of the arrangement of a lens, ofa visible light source and of an infrared light source of an automaticlighting device according to an embodiment of the invention;

FIG. 7 shows a schematic representation of the arrangement of a firstvisible light source and of a second visible light source of anautomatic lighting device according to an embodiment of the invention;

FIG. 8 shows a schematic representation of a processing of an image by aprocessing unit of an automatic lighting device according to anembodiment of the invention;

FIG. 9 displays a flow chart of an identification method using an imagesensor according to the invention in a number of its embodiments;

FIG. 10 displays a flow chart of a detection method of regions ofinterest in a scene according to some embodiments of the invention;

FIG. 11 displays a flow chart of a tracking method of regions ofinterest that have been detected in a scene according to someembodiments of the invention;

FIG. 12 displays an architecture of a learning/classification process ofregions of interest that are tracked in a scene according to someembodiments of the invention.

DETAILED DESCRIPTION

FIG. 1 shows a schematic representation of an automatic lighting device100 according to a first embodiment of the invention. The device 100comprises:

-   -   an infrared light source 40,    -   a camera 10 comprising a lens Ob and a sensor Ca,    -   a processing unit 20 for processing at least one image,    -   a visible light source 50,    -   a control unit 30 for controlling the visible light source 50,        and    -   a protection element 60 for the infrared light source 40, for        the visible light source 50 and for the lens Ob.

“Visible light” is typically understood to mean a light visible to ahuman user, that is to say a light whose wavelength belongssubstantially to the range [380 nm; 780 nm]. “Infrared light” istypically understood to mean a light invisible to a human user and whosewavelength is greater than 780 nm. The infrared light source can be alight-emitting diode, or LED. Similarly, the visible light source can bean LED, or, alternatively, a halogen lamp or a neon lamp, etc. Thevisible light source, the infrared light source and the camera can becombined in a single module, as represented in FIG. 1. According to analternative, the visible light source can be located in a first module,whereas the infrared light source and the camera are combined in asecond module distinct from the first module. According to anotheralternative, the visible light source can be located in a first module,the infrared light source can be located in a second module distinctfrom the first module, and the camera can be located in a third moduledistinct from the first and second modules.

In a first mode of operation, the infrared light source 40 is activatedpermanently. In a second mode of operation, the infrared light source 40can be deactivated. The first mode of operation is, for example,activated during the night. The second mode of operation is, forexample, activated during the day. In the first mode of operation, anenvironment is thus lit with infrared light at each instant. The camera10 can then film an environment lit with infrared light.

Each image filmed by the camera 10 is typically obtained by virtue ofthe infrared light reflected by the environment and arriving at thesensor Ca. The sensor Ca of the camera 10 is, for example, a CMOSsensor.

The processing unit 20 can, for example, be a microcontroller or amicroprocessor. Similarly, the control unit 30 can, for example, be amicrocontroller or a microprocessor. A single microcontroller ormicroprocessor can simultaneously comprise the processing unit 20 andthe control unit 30.

The protection element 60 seals the device 100 and thus allows for itsuse in an outside environment, while being transparent to the infraredlight and to the visible light.

FIG. 2 shows a schematic representation of an automatic lighting device101 according to a second embodiment of the invention. The device 101according to the second embodiment of the invention comprises aseparation element Se, which separates the infrared light source 40 andthe visible light source 50 on the one hand, and the camera 10 on theother hand. The separation element Se makes it possible to prevent aradiation from the infrared light source 40 and/or a radiation from thevisible light source 50 from reaching the sensor Ca of the camera 10.

According to the second embodiment of the invention, the protectionelement 60 is split up into a first part 61 for the protection of theinfrared light source 40 and of the visible light source 50, and asecond part 62 for the protection of the camera 10.

FIG. 3 shows a schematic representation of an automatic lighting device102 according to a third embodiment of the invention. The device 102according to the third embodiment of the invention comprises an infraredfilter fIR. The infrared filter fIR can typically be arranged in a firstposition or in a second position, which are respectively illustrated inconnection with FIGS. 4a and 4 b.

FIG. 4a shows a first cross-sectional view of the device 102 accordingto the third embodiment of the invention. FIG. 4a shows the infraredfilter fIR arranged in the first position. In the first position, theinfrared filter fIR is separated from the sensor Ca so that the infraredlight can penetrate into the sensor Ca.

FIG. 4b shows a second cross-sectional view of the device 102 accordingto the third embodiment of the invention. FIG. 4b shows the infraredfilter fIR arranged in the second position. In the second position, theinfrared filter fIR is placed between the lens Ob and the sensor Ca ofthe camera 10 in order to prevent the infrared light from penetratinginto the sensor Ca.

The automatic lighting device 102 according to the third embodiment canadvantageously operate at any time of the day or of the night: theinfrared filter fIR is placed in its first position during the night,and in its second position during the day. It is in fact desirable tocut the infrared light emitted by the sun during the day, in order toimprove the rendering of the images picked up by the camera 10, for ahuman user.

The second and third embodiments which have just been described can becombined together, to obtain an automatic lighting device comprising theseparation element Se and the infrared filter fIR.

FIG. 5 shows a cross-sectional view of an automatic lighting device 102′according to a variant of the third embodiment of the invention. Theautomatic lighting device 102′ comprises a plurality of infrared lightsources and a plurality of visible light sources. In the particularexample of FIG. 5, the plurality of infrared light sources comprises theinfrared light source 40 and a second infrared light source 41.Alternatively, the plurality of infrared light sources can comprisethree or more infrared light sources. Still in the particular example ofFIG. 5, the plurality of visible light sources comprises the visiblelight source 50 and a second visible light source 51. Alternatively, theplurality of visible light sources can comprise three or more visiblelight sources.

The variant of the third embodiment which has just been described iscompatible with the first and second embodiments. In other words:

-   -   the device 100 according to the first embodiment can comprise,        according to a variant, a plurality of infrared light sources        and a plurality of visible light sources, and    -   the device 101 according to the second embodiment can comprise,        according to a variant, a plurality of infrared light sources        and a plurality of visible light sources.

According to a second variant, not illustrated, of the first, second andthird embodiments, the automatic lighting device can comprise a singleinfrared light source and a plurality of visible light sources.According to a third variant, not illustrated, of the first, second andthird embodiments, the automatic lighting device can comprise aplurality of infrared light sources and a single visible light source.

The automatic lighting device according to one of the embodiments of theinvention advantageously comprises an accelerometer. A motion of theautomatic lighting device can thus be detected, in order to avoid, ifnecessary, an incorrect detection of a motion within the environmentobserved.

The automatic lighting device according to one of the embodiments of theinvention advantageously comprises a communication interface making itpossible to receive signals from at least one mobile terminal, andtransmit signals to at least one mobile terminal. The communicationinterface can, for example, be a radiofrequency interface, or a Wi-Fiinterface, or a Bluetooth interface, or a Zigbee interface, etc.

FIG. 6 shows a schematic representation of the arrangement of the lensOb, of the visible light source 50 and of the infrared light source 40of an automatic lighting device according to one of the embodiments ofthe invention. The lens Ob, which has an axis of revolution A,comprises:

-   -   a first face f1 having a normal vector nf1 oriented towards the        sensor Ca, and    -   a second face f2 having a normal vector nf2 oriented towards the        environment.

A first plane P1, tangential to the first face f1 and at right angles tothe axis of revolution A of the lens Ob, defines:

-   -   a first half-space dE1, to which the sensor Ca belongs, and    -   a second half-space dE2, to which the second face f2 of the lens        Ob and the environment belong.

FIG. 6 shows that:

-   -   the visible light source 50 has a cone of emission c50, of axis        A50 and of vertex s50, and    -   the infrared light source 40 has a cone of emission c40, of axis        A40 and of vertex s40.

In order for the cone of emission c50 of the visible light source 50 notto be incident on the first face f1 of the lens Ob, the visible lightsource 50 is advantageously arranged such that the vertex s50 of thecone of emission c50 is located in the second half-space dE2.

Similarly, in order for the cone of emission c40 of the infrared lightsource 40 not to be incident on the first face f1 of the lens Ob, theinfrared light source 40 is advantageously arranged such that the vertexs40 of the cone of emission c40 is located in the second half-space dE2.

The automatic lighting device according to one of the embodiments of theinvention preferentially comprises the protection element 60. Theradiation emitted by the infrared light source 40 is likely to bepartially reflected by the protection element 60. In order to avoid sucha radiation reflected on the protection element 60 from reaching thesecond face f2 of the lens Ob, the infrared light source 40 isadvantageously arranged such that, in the second half-space dE2, thedistance between the axis A40 of the infrared light source 40 and theaxis of revolution A of the lens Ob is constant or increasing whenmoving away from the first plane P1.

FIG. 6 shows, for example:

-   -   a first distance D1 measured between the axis of revolution A of        the lens and the axis A40 of the infrared light source 40, at a        first distance from the first plane P1 in the second half-space        dE2, and    -   a second distance D2 measured between the axis of revolution A        of the lens and the axis A40 of the infrared light source 40, at        a second distance, greater than the first distance, from the        first plane P1 in the second half-space dE2.

The second distance D2 is greater than or equal to the first distanceD1.

Similarly, the radiation emitted by the visible light source 50 islikely to be partially reflected by the protection element 60. In orderto avoid such a radiation reflected on the protection element 60 fromreaching the second face f2 of the lens Ob, the visible light source 50is advantageously arranged such that, in the second half-space dE2, thedistance between the axis A50 of the visible light source 50 and theaxis of revolution A of the lens Ob is constant or increasing whenmoving away from the first plane P1.

When the automatic lighting device according to an aspect of theinvention comprises a plurality of visible light sources, each visiblelight source having a cone of emission, said plurality is preferentiallyarranged so as to obtain, in the second half-space dE2, a region inwhich at least two cones of emission of visible light overlap.

Similarly, when the automatic lighting device according to an aspect ofthe invention comprises as plurality of infrared light sources, eachinfrared light source having a cone of emission, said plurality ispreferentially arranged so as to obtain, in the second half-space dE2, aregion in which at least two cones of emission of infrared lightoverlap.

In this respect, FIG. 7 shows a schematic representation of thearrangement of the visible light sources of an automatic lighting devicecomprising a plurality of visible light sources. The device of FIG. 7comprises:

-   -   the visible light source 50 having the cone of emission c50, the        axis A50 and the vertex s50, and    -   the second visible light source 51 having a cone of emission        c51, an axis A51 and a vertex s51.

The visible light source 50 and the second visible light source 51 areadvantageously arranged so that, in the first half-space dE1, thedistance between the axis A50 of the visible light source 50 and theaxis A51 of the second visible light source 51 is constant or increasingwhen moving away from the first plane P1.

FIG. 7 shows, for example:

-   -   a third distance D3 measured between the axis A50 of the visible        light source and the axis A51 of the second visible light        source, at a first distance from the first plane P1 in the first        half-space dE1, and    -   a fourth distance D4 measured between the axis A50 of the        visible light source and the axis A51 of the second visible        light source, at a second distance, greater than the first        distance, from the first plane P1 in the first half-space dE1.

The fourth distance D4 is greater than or equal to the third distanceD3.

The arrangement illustrated in FIG. 7 for a plurality of visible lightsources can be transposed to a plurality of infrared light sources.

FIG. 8 shows a schematic representation of a processing of an image Imby the processing unit 20 of an automatic lighting device according toone of the embodiments of the invention. In the particular examplerepresented in FIG. 8, the processing unit 20 detects first, second andthird areas of interest z1, z2 and z3 in the image Im. The first area ofinterest z1 is, for example, a pedestrian in motion. The second area ofinterest z2 is, for example, a vehicle in motion. The third area ofinterest z3 is, for example, an animal in motion. The processing unit 20defines a first thumbnail image v1 for the first area of interest z1, asecond thumbnail image v2 for the second area of interest z2 and a thirdthumbnail image v3 for the third area of interest z3. The processingunit 20 assigns, to each area of interest, a class out of a plurality ofclasses. In a first example, the plurality of classes comprises:

-   -   a first class concerning a first category, and    -   a second class concerning all the elements not belonging to the        first category.

According to the first example, the control unit 30 can activate thevisible light source as soon as the first class is assigned to at leastone thumbnail image.

The first category is, for example, that of pedestrians. Alternatively,the first category can be that of animals or of vehicles. In the casewhere the first category is that of pedestrians, the processing unit 20assigns the first class to the first thumbnail image v1, and the secondclass to the second and third thumbnail images v2 and v3.

In a second example, the plurality of classes comprises:

-   -   a first class concerning the first category,    -   a second class concerning a second category distinct from the        first category, and    -   a third class concerning all the elements belonging neither to        the first category nor to the second category.

In the case where the first category is that of pedestrians, the secondcategory is, for example, that of animals or that of vehicles. Accordingto the second example, the control unit 30 can activate the visiblelight source as soon as the first class is assigned to at least onethumbnail image or as soon as the second class is assigned to at leastone thumbnail image.

In a third example, the plurality of classes comprises:

-   -   a first class concerning the first category,    -   a second class concerning the second category,    -   a third class concerning a third category, and    -   a fourth class concerning all the elements belonging neither to        the first category, nor to the second category, nor to the third        category.

In the case where the first category is that of pedestrians and wherethe second category is that of animals, the third category is, forexample, that of vehicles. According to the third example, the controlunit 30 can activate the visible light source as soon as the first classis assigned to at least one thumbnail image or as soon as the secondclass is assigned to at least one thumbnail image or as soon as thethird class is assigned to at least one thumbnail image.

FIG. 9 displays a flow chart of an identification method using an imagesensor according to the invention in a number of its embodiments.

According to the invention, the lighting device 100 comprises aprocessing unit 20 that is configured to determine an object of interestthat will trigger one or more actions. One of the actions is to setthrough a control unit 30 one or more sources 50, 51 of visible light ONor to leave it in an OFF state depending upon a type of the object ofinterest that is lighted by one or more infrared (IR) light sources 40,41 and detected by an image sensor 10. Another possible action is totrigger an alarm that may be generated locally or sent to a remotelocation. The owner of the property where the device is installed or awatchman tasked with monitoring the property may then take appropriateaction, based notably on the images captured by the image sensor 10 thatmay be sent to the owner or the watchman on a device using acommunication link.

According to the invention, a number of steps have to be implementedbefore an appropriate command can be sent to the control unit.

The processing unit 20 comprises processing logic that may be embeddedin the hardware of the lighting device or stored in a memory connectedto the processing unit to determine if an event occurring in the fieldof view of the image sensor should or not trigger a command or an alarm.

The processing logic is configured to minimize the number of falsealarms, maximize the number of true detection of alarming events andminimize the processing power used.

The inventors have determined that to achieve this optimization it isadvantageous to use a processing architecture that implements threesuccessive processing steps of image analysis:

-   -   At a first step 910, a moving foreground is detected by        separation from a still background by analyzing series of images        from the sensor;    -   At a second step 920, features of the detected moving        foregrounds are tracked to confirm whether they are valid        objects of interest;    -   At a third step 930, the tracked valid objects of interest are        classified into predetermined classes or types using a        classifier that implements a deep learning technique.

Image analysis is a field of computer technology that is used to extractmeaningful information from images. In the use case of preferredembodiments of the invention, it is applied to a scene surrounding abuilding that comprises Regions of Interest (RoI), i.e. regions wheremoving objects are detected and then classified into types of Objects ofInterest (OoI) that are present in the scene. In-between the step ofdetection and the step of classifying, characterizing features of themoving objects are tracked.

In a variant of the invention, the output of the classifying step 930that comprise probabilities of an object being an Object of Interest(OoI) of a predefined type (human, animal, car, etc. . . . ) may befurther processed to de-duplicate the OoI to check if they have alreadybeen seen earlier. In this variant, the probabilities that an OoIbelongs to one of a defined class are passed (step 931) to ade-duplication step 932. If the OoI has been seen before, the OoI isdiscarded and no action (setting the light source ON, triggering analarm or sending a notification) is taken and the OoI is ignored (step933). If the OoI has not been seen in a recent sequence of frames, oneor more of the actions of setting the light source ON, triggering analarm or notifying a user are performed (step 940). The time that istaken into account to determine that the OoI has been seen before is amatter of seconds. It may be user defined, or it may be defined by thememory allocation to this function in the device.

The appropriate command or alarm may be triggered with minimal falsealarms and maximal true positives, having used a processing power thatis consistent with the capacity of the processing unit in a time that isconsistent with the use case.

In another variant, it may be proposed to some user to reportclassification errors. These errors are fed to the classifier to improvethe probabilities of true classification and minimize false positives.

The operations performed at each of steps 910, 920 and 930 are describedin detail further below respectively in relation with FIGS. 10, 11 and12.

In some use cases, the classes or types of the objects of interest mayfor instance be: humans; animals; cars. But other classes may be added.Or only one class or two classes may be selected to trigger setting thelights ON or triggering an alarm.

FIG. 10 displays a flow chart of a detection method of regions ofinterest in a scene according to some embodiments of the invention.

The purpose of the step of detection of regions of interest in a sceneis to differentiate in a series of images of a scene a movingforeground, that will include the regions of interest, from a stillbackground. The method consists in first modeling the background of thescene to provide an image of reference. Then, a comparison between therunning image and the image of reference (i.e. background subtraction orforeground extraction) yields pixels labeled as “in movement”. Adesigner of a method to efficiently perform this step will encounter anumber of difficulties, notably:

-   -   illumination changes, slow with the position of the sun or the        moon during the day/night, or sudden with the movements of        clouds in the sky;    -   dynamic background, such as trees moving in the wind or traffic        lights changing color;    -   camouflage, when moving objects that do not contrast with the        background scene;    -   shadows, that may complicate the classification, typically when        shape-based;    -   changing background, e.g. when a still vehicle starts moving, a        part of the scene that was so far considered as background will        become moving foreground . . .    -   image sensor noise, that may come from the sensor itself or from        the image processing associated with it (notably compression)        and will be reproduced at the output of the detection.

Other artifacts may also impact the quality of the detection, but theinventors believe that, having addressed the ones listed above, theyhave come to a detection method that is robust enough to face most ofthe artifacts that they have not specifically identified.

A first principle applied by the inventors is to update their BackgroundModel (BM, 1010) often enough. BM is constructed from a number of framespreceding the current image frame that are stored in a FIFO (“First InFirst Out”) memory. The size n of the used pixels in the FIFO should besmall enough to avoid an impact of reasonably slow illumination changesand large enough to include parts of the scene that are not normallymoving and should be considered as background. The inventors havedetermined experimentally that a duration of a few seconds (or 50 to 250frames at 24 fps—i.e. frames per second) is a good compromise. Note thatthe Y luminance data in a YUV encoding by the image sensor processing issufficient to extract information from a series of images of a scene toconstruct the BM.

An efficient BM may be built by making the assumption that pixels thattake the luminance value of the median of the buffer belong to thebackground. But calculating a median of a series that varies over timeis computationally complex. This is why, in a variant, the inventors usea rolling average of the series of pixel luminance values in the buffer.

To compute the rolling average, a number of selections of the pixels inthe buffer may be made: either the p most recent corresponding pixels inthe buffer or the p oldest pixels in the buffer, where p is the numberof pixels selected to correspond to the number n of pixels in the FIFOdetermined to be optimal as explained above. It has been determinedexperimentally by the inventors that it is advantageous to select theoption that yields the mean that is the closest to the current BM.

At a step 1050, a motion image is constructed by setting the luminancevalue of a pixel in a frame to 1 when the subtraction of the luminanceof the corresponding pixel of the BM frame from the corresponding pixelin the input frame (that may be a preprocessed frame 1020, in case acleansing of the frames is performed, i.e. to suppress noise asexplained below) is higher than a calculated luminance of acorresponding pixel in a Threshold Image of the frame (TI), and settingthis luminance value to 0 when this condition is not met.

Before running the 1050 test, a dynamic Threshold Image, TI, iscalculated (step 1040). It has been determined by the inventors that afixed threshold creates a large number of false negatives in shadedareas, whereas it is not the case in bright areas. To offset thisundesirable effect, a Shifted Variance is calculated at a step 1040. TheShifted Variance is calculated at a step 1030, so that:

${\forall s},{{\tau(s)} = {{\alpha\left( \frac{\overset{¯}{s}}{255} \right)}^{\beta}{\sigma_{shifted}(s)}}}$Where:

-   -   s is the current pixel;    -   τ(s) is the threshold corresponding to the current s pixel;    -   σ_(shifted)(s) is the Shifted Variance corresponding to the        current s pixel;    -   α, β are parameters that are selected based on an heuristic.

The heuristic is based on two considerations:

-   -   In bright areas, the threshold should be higher;    -   For pixels with a high variance, the threshold should also be        higher.

The inventors have determined that setting the parameters α and βrespectively at 30 and 3 will decrease the false negative rate in shadedareas without increasing the false positive rate in bright areas, butother values are possible.

In some embodiments of the invention, both the BM and the current framemay be blurred (i.e. their contrast diminished) through a preprocessingstep (1020) to reduce the impact of noise.

The thresholding 1050 is the result of an extraction of the images suchthat: |PF−BM|>TI. This step produced a First Foreground frame 1060.

Then, in some embodiments of the invention, a Background Cleaning may beperformed (1070) by subtracting from the current frame the FirstForeground frame. This yields a Modified Background BM′ (1080) withwhich a second thresholding may be performed (1090) to yield a SecondForeground frame (10A0).

Then, in some embodiments of the invention, a post-processing of theSecond Foreground frame 10A0 may be performed at a step 1060. One of thegoals of this step will be to eliminate parts of the image that may benoise and that are anyway too small to be properly classified. We canfor instance determine the minimum size in pixel that is necessary todetect a person of 1.6 m height using opto-geometrical relationshipssuch as:

$h_{m} = \frac{HW}{2\tan\theta \times D_{M}}$where:

-   -   H is the minimum height of the object or person we want to        detect;    -   W is the width in pixels of the frame;    -   θ is half the horizontal angle of view;    -   D_(M) is the maximum distance of detection.

With an image sensor of 5 M pixels the minim size of objects of 1.6 mheight that will be detectable with the sensor from 20 m is about 100pixels. Combining minimum height and width allows defining a structuringelement or Bounding Box (BB). Objects in the foreground of a size lowerthan BB but close enough will be grouped, whereas those of also a sizelower than BB but isolated will be filtered out.

The output of the detection process is a set of BB vectors 10C0 that arepassed to the tracking process.

The detection process of the invention is remarkable notably in that itconsiders only the grey levels of the image pixels and compensates forthe “ghosting” effect in calculating a shifted variance.

The detection process of the invention has been described with a numberof specific features, but it is to be understood that a number of themare optional, in the sense that they may improve the performance, butare not mandatory to achieve an acceptable result.

FIG. 11 displays a flow chart of a tracking method of regions ofinterest that have been detected in a scene according to someembodiments of the invention.

The detection process described above notably presents the advantage ofallowing loosing some BBs. Accordingly, the tracking may be simpler thanthose of the prior art.

The tracking process of the invention is derived from a method describedin Bouguet (“Pyramidal Implementation of the Lucas Kanade FeatureTracker”, Intel Corp. Microprocessor Research Labs, 2000). This processbuilds on Lucas and Kanade, “An Iterative Image Registration Techniquewith an Application to Stereo Vision”, Proceedings of the 7^(th)International Joint Conference on Artificial Intelligence, Vol. 2, IJCAI'81, pp. 674-679, 1981, and on Tomasi and Shi, “Good Features to Track”,1994 I3E Conference on Computer Vision and Pattern Recognition, CVPR'94, pp. 593-600, 1994.

In some embodiments of the invention, at each foreground extractionoutput from the detection process, detected BBs are compared withexisting trackers' locations, leading to the creation of new trackerswhen a comparable tracker is not yet present in the plurality ofexisting trackers. The trackers search for Good Features (GFs) in theBBs attributed to them. The GFs are then followed from frame to frameusing a modified pyramidal Lucas Kanade feature tracker described in thereferences cited above. The algorithm used is of the type describedbelow:

An equation of the form Zd=e has to be solved where Z is a 2×2 matrixcomputed on the image, d is the translation that is to be found, e is anerror vector.

Matrix has to satisfy a minimization criterion of its eigen values λ₁and λ₂: Min(λ₁, λ₂)>λ where λ is a threshold selected appropriately bytrial and error.

Then, the minimal error vector is calculated by using the followingformula:e=∫∫ _(W)[J(A(Ax+d)−I(x)]² w(x)dxwhere w is a weighting function that has to be selected to minimize e inorder to find the transformation of the window W from frame I to frameJ. This allows discriminating between real physical points and depthdiscontinuities or other unreliable points, such as occluding featuresthat actually move independently or that are produced by reflections oflight.

According to some embodiments of the invention, the tracking process maybe implemented through the following steps.

At steps 1111, 1112, Bounded Block BB_(i), BB_(i+1) output by thedetection process are acquired by the tracking process. At a step 1121,a tracker T_(j) is created as a result of previous steps (notillustrated on the figure). At a step 1131, BB_(i), BB_(i+1) arecompared to T_(j). If the comparison tests are successful, T_(j) absorbsBB_(i) and/or BB_(i+1) (1141). If the comparison tests fail, a newtracker T_(j+1) is created (1142).

The GFs in the trackers T_(j), T_(j+1) are updated and monitored using(1151), in some embodiments of the invention, the following data:

-   -   their coordinates;    -   their last and before last displacements;    -   a number of motion-related counters.

The motion-related counters may comprise a counter of correlatedmovements that may be incremented when the last and before lastdisplacements are about in the same direction. They may also comprise acounter of immobility that may be incremented when the last displacementis below a threshold and set to zero when it is above this threshold.Then, a number of states may be defined (for instance, valid, neutraland bad) to decide whether a feature's movement in a tracker qualifiesthe said feature to be a GF.

Then, at a step 1161, a number of decisions are made by the trackingalgorithm: when the state is bad, the feature is killed; new GFs arealso created based on the same heuristic, if they are close enough toother GFs. Trackers may also be merged.

Then, at a step 1171, Vignettes V_(k) are created with the trackershaving sufficient number of GFs. In some embodiments of the invention,the vignettes may be ranked by an index of quality.

The tracking process of the invention is remarkable in that it yieldsbetter results than the tracking processes of the prior art cited above,notably in a use case that may characterized by a variety of objects tobe tracked that are possibly moving at different speeds and on a blurredbackground.

The tracking process of the invention has been described with a numberof specific features, but it is to be understood that a number of themare optional, in the sense that they may improve the performance, butare not mandatory to achieve an acceptable result.

FIG. 12 displays an architecture of a learning/classification process ofregions of interest that are tracked in a scene according to someembodiments of the invention.

According to some embodiments of the invention, a deep learningclassification technique based on convolutional neural networks (CNN) isused. The assumption that a CNN classifier is well suited to the problemto be solved is based on the idea that patterns that are present in avignette have a significant probability to be present elsewhere. Also, aCNN is a multi-stage learning method where the neurons are locallyconnected and not connected to all the layers of the network. Groups ofneurons sharing the same parameters are spread out regularly to coverthe entire image. This allows a more computationally efficientprocessing.

A description of a CNN classifier of the prior art may be found inGarschik and alii, “Rich Feature Hierarchies for Accurate ObjectDetection and Semantic Detection”, 2014 I3E Conference on ComputerVision and Pattern Recognition, CVPR 2014, Colombus, Ohio, USA, pp.580-587, 2014.

Classification and learning are performed by a CNN at the same time. Anumber of different architectures of CNN may be used to implement theinvention. The architecture presented on figure is thereforeillustrative only and not limitative. Also, it is possible to implementthe invention with a classification method that is different from a CNN.For example, a method described in Viola and alii “Rapid ObjectDetection Using a Boosted Cascade of Simple Features”, 2001 I3E,Computer Society Conference on Computer Vision and Pattern Recognition(CVPR 2001), Kawai, Hi., USA, pp. 511-518, 2001, or in Dalal et alii“Histograms of Oriented Gradients for Human Detection”, InternationalConference on Computer Vision and Patter Recognition, vol. 2, pp.886-893, June 2005, or in Lowe, “Object Recognition from LocalScale-Invariant Features”, Proceedings of the International Conferenceon Computer Vision, vol. 2, ICCV '99, pp. 1150-, 1999.

In some embodiments of the invention, the CNN used to classify theobjects of interest detected, tracked and conditioned into VignettesV_(k) comprises:

-   -   A number of Convolutional Layers (CL_(i)), 1211, wherein        convolutional products are applied to the input vignettes using        kernel matrices of dimensions 1×1, 3×3, 5×5 and 1×1; these        dimensions have been tested as adapted to some exemplary use        cases of the invention, but they may be set at different values;        A number of non-Linear Transformation Layers (nLTL_(j)), 1221        are also provisioned; examples of nLTLs are: a Depth        Concatenation to normalize the output of the CLs;    -   a Pooling Layer to reduce the size of the problem by grouping a        number of parameters; a Drop_Out Layer to eliminate elements        that do not add information that is useful to improve the        quality of the classification. Further operations are performed        by a Fully Connected Layer (FCL, 1241); FCL are similar to CL in        the sense that they apply a convolution product to their input,        but their kernel has the dimensions of the input vignette; it        has been observed by the inventors that it is advantageous to        use a single FCL; but in some use cases, it is possible to use        as many FCLs as classes of interest, each FCL dedicated to one        of the “hyper-classes” that are one of the use case of the        invention, i.e. Humans (HC_H), Animals(HC_A), Cars(HC_C);    -   Finally, for the output of each FCL, predictions of the        probability that the class of a vignette V_(k) is a human, an        animal or a vehicle are determined using a softmax cost function        1251 to adjust the coefficients of the Active Layers of the CNN        that are applied; the softmax cost function cannot be solved        analytically is most cases; one may use for instance a gradient        descent or a backpropagation algorithm to solve the softmax cost        function at each iteration.

A number of parameters of the various modules of the CNN may be tuned bytrial and error to adjust performance in terms of the best compromisebetween true and false positive and processing power needed, forinstance the size of the input vignettes, the dimensions of the kernelsof the CLs, the use of a cascading approach to eliminate the falsepositives, the initialization of the FCL to increase the speed ofconvergence. For instance a matrix of 112×112 pixels for the vignette atthe output of the tracking process has been determined to be a goodchoice.

The examples disclosed in this specification are only illustrative ofsome embodiments of the invention. They do not in any way limit thescope of said invention which is defined by the appended claims.

The invention claimed is:
 1. A device comprising: one or more infraredlight sources; one or more visible light sources; an image sensor; aprocessing unit configured to analyze a series of images of a region ofinterest output by the image sensor; a control unit configured togenerate one or more of an activation of the one or more visible lightsources or an alarm based on a command received from the processingunit; wherein the analyzing comprises detecting a moving foreground inthe series of images of the region of interest, tracking one or morecharacterizing features in the moving foreground and classifying the oneor more characterizing features into two of more types of moving objectsof interest, a type of a moving object of interest determining a commandsent by the processing unit to the control unit; and wherein thedetecting comprises comparing difference images between the series ofimages of the region of interest and images of a Background Model ofsaid region of interest to threshold images, the threshold images beingcalculated dynamically using a shift-variance, and the trackingcomprises allocating a Good Feature value to a characterizing feature inBounded Blocks output by the detecting if a counter of correlatedmovements of the characterizing feature is increased and a counter ofimmobility is equal to zero.
 2. The device of claim 1, further connectedto a network through a communication link, wherein the alarm is sent toa user device on the communication link.
 3. The device of claim 2,wherein the control unit further triggers images of the moving object ofinterest to be sent to the user device on the communication link.
 4. Thedevice of claim 1, wherein the detecting uses a Y luminance value in aYUV encoding of pixels in the series of images.
 5. The device of claim1, wherein the tracking further comprises creating a vignette with aBounded Block having a number of Good Features higher than a threshold.6. The device of claim 5, wherein the classifying comprises using one ormore of a Neural Network, a History of Oriented Gradient or a SupportVector Machine classifier.
 7. The device of claim 6, wherein the NeuralNetwork is a Convolutional Neural Network classifier and comprises oneor more Fully Connected Layers.
 8. The device of claim 1, wherein: thecamera comprises a lens and an infrared light and visible light sensor,the at least one infrared light source has a cone of emission ofinfrared light, the at least one visible light source has a cone ofemission of visible light, there is no intersection between the lens ofthe camera on the one hand and the cones of emission of infrared lightand of visible light on the other hand.
 9. The device of claim 8,wherein the lens has an axis of revolution A and comprises a first facehaving a normal vector oriented towards the sensor and a second facehaving a normal vector oriented towards the environment, and in which afirst plane tangential to the first face and at right angles to the axisof revolution A defines a first half-space to which the sensor belongsand a second half-space to which the second face of the lens and theenvironment belong, and: the cone of emission of the at least oneinfrared light source has a vertex arranged in the second half-space;the cone of emission of the at least one visible light source has avertex arranged in the second half-space.
 10. The device of claim 9,wherein: the at least one infrared light source has a cone of emissionof axis A40, the at least one visible light source has a cone ofemission of axis A50, and the camera has a cone of absorption of axis A,in the second half-space, the distance between the axis A40 and the axisA is constant or increasing when moving away from the first plane, andin the second half-space, the distance between the axis A50 and the axisA is constant or increasing when moving away from the first plane. 11.The device of claim 5, comprising a plurality of visible light sources,each visible light source having a cone of emission having an axis,wherein in the first half-space, for each visible light source of theplurality of visible light sources, the distance between the axis of thecone of emission of said source and the axis of the cone of emission ofeach other source is constant or increasing when moving away from thefirst plane.
 12. The device of claim 5, wherein the lens has an axis ofrevolution A, further comprising a protection element for the at leastone infrared light source, for the at least one visible light source andfor the lens of the camera, the protection element being transparent tothe infrared light and to the visible light, the protection elementextending substantially along a plane at right angles to the axis ofrevolution A.
 13. A method of monitoring a region of interestcomprising: lighting the region of interest with one or more infraredlight sources; capturing series of images of the region of interest byan image sensor; analyzing by a processing unit the series of images ofthe region of interest output by the image sensor; generating by acontrol unit one or more of an activation of one or more visible lightsources or an alarm based on a command received from the processingunit; wherein the analyzing comprises detecting a moving foreground inthe series of images of the region of interest, tracking one or morecharacterizing features in the moving foreground and classifying the oneor more characterizing features into two of more types of moving objectsof interest, a type of a moving object of interest determining a commandsent by the processing unit to the control unit; and wherein thedetecting comprises comparing difference images between the series ofimages of the region of interest and images of a Background Model ofsaid region of interest to threshold images, the threshold images beingcalculated dynamically using a shift-variance, and the trackingcomprises allocating a Good Feature value to a characterizing feature inBounded Blocks output by the detecting if a counter of correlatedmovements of the characterizing feature is increased and a counter ofimmobility is equal to zero.
 14. A device comprising: one or moreinfrared light sources; one or more visible light sources; an imagesensor; a processing unit configured to analyze a series of images of aregion of interest output by the image sensor; a control unit configuredto generate one or more of an activation of the one or more visiblelight sources or an alarm based on a command received from theprocessing unit; wherein the analyzing comprises detecting a movingforeground in the series of images of the region of interest, trackingone or more characterizing features in the moving foreground andclassifying the one or more characterizing features into two of moretypes of moving objects of interest, a type of a moving object ofinterest determining a command sent by the processing unit to thecontrol unit, wherein: the camera comprises a lens and an infrared lightand visible light sensor, the at least one infrared light source has acone of emission of infrared light, the at least one visible lightsource has a cone of emission of visible light, there is no intersectionbetween the lens of the camera on the one hand and the cones of emissionof infrared light and of visible light on the other hand.